import request from '@/config/axios'

// 家族故事 VO
export interface StoriesVO {
  id: number // 故事唯一标识
  title: string // 故事标题
  content: string // 故事内容
  mediaUrl: string // 多媒体文件URL（可选）
  createTime: string // 创建时间
}

// 家族故事 API
export const StoriesApi = {
  // 查询家族故事分页
  getStoriesPage: async (params: any) => {
    return await request.get({ url: `/family/stories/page`, params })
  },

  // 查询家族故事详情
  getStories: async (id: number) => {
    return await request.get({ url: `/family/stories/get?id=` + id })
  },

  // 新增家族故事
  createStories: async (data: StoriesVO) => {
    return await request.post({ url: `/family/stories/create`, data })
  },

  // 修改家族故事
  updateStories: async (data: StoriesVO) => {
    return await request.put({ url: `/family/stories/update`, data })
  },

  // 删除家族故事
  deleteStories: async (id: number) => {
    return await request.delete({ url: `/family/stories/delete?id=` + id })
  },

  // 导出家族故事 Excel
  exportStories: async (params) => {
    return await request.download({ url: `/family/stories/export-excel`, params })
  },
}
